<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateManagementIndexWeightTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('management_index_weight', function (Blueprint $table) {
//            $table->comment('管理指标权重设置表');
            $table->bigInteger('id', true)->comment('主键id');
            $table->bigInteger('school_id')->nullable()->comment('学校id');
            $table->string('school_name', 255)->nullable()->comment('学校名称');
            $table->bigInteger('grade_id')->nullable()->comment('年级id');
            $table->string('grade_name', 255)->nullable()->comment('年级名称');
            $table->bigInteger('class_id')->nullable()->comment('班级id');
            $table->string('class_name', 255)->nullable()->comment('班级名称');
            $table->bigInteger('teacher_id')->nullable()->comment('教师id');
            $table->string('teacher_name', 255)->nullable()->comment('教师姓名');
            $table->string('year', 255)->nullable()->comment('学年');
            $table->integer('semester')->nullable()->comment('学期');
            $table->decimal('read_recit_task_weight', 10)->nullable()->comment('布置朗读背诵任务');
            $table->decimal('all_task_weight', 10)->nullable()->comment('布置所有任务数');
            $table->decimal('loud_read_task_weight', 10)->nullable()->comment('朗读背诵已阅学生任务数');
            $table->decimal('task_finish_weight', 10)->nullable()->comment('所有任务完成率');
            $table->decimal('daily_read_weight', 10)->nullable()->comment('每日阅读打卡任务完成率');
            $table->decimal('common_evaluation_teacher_weight', 10)->nullable()->comment('作文互评任务教师评价完成率');
            $table->decimal('read_minutes_weight', 10)->nullable()->comment('阅读时长');
            $table->decimal('one_time_pass_weight', 10)->nullable()->comment('朗读背诵一次通过率');
            $table->decimal('question_accuracy_weight', 10)->nullable()->comment('题目正确率');
            $table->decimal('dolphin_count_weight', 10)->nullable()->comment('小海豚数量');
            $table->decimal('common_evaluation_consistency_weight', 10)->nullable()->comment('作文互评任务师生一致率');
            $table->dateTime('create_time')->nullable()->useCurrent()->comment('创建时间');
            $table->bigInteger('creator_id')->nullable()->default(0)->comment('创建者');
            $table->dateTime('update_time')->nullable()->useCurrent()->comment('修改时间');
            $table->bigInteger('updater_id')->nullable()->default(0)->comment('修改者');
            $table->integer('deleted')->nullable()->default(0)->comment('是否删除【0：否，1：是】');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('management_index_weight');
    }
};
